﻿@model List<Category>

<link rel="stylesheet" href="~/css/components/navbar.min.css" />

<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
    <div class="container">
        <a class="navbar-brand" asp-controller="Home" asp-action="Index">@ViewBag.Profile.Name</a>
        <button class="btn navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbar">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" asp-controller="Home" asp-action="Index">Home </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" asp-controller="Blog" asp-action="Index">Blog</a>
                </li>

                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        Categories
                    </a>
                    <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                        @if (Model.Count == 0)
                        {
                            <a class="dropdown-item">There's nothing here.</a>
                        }
                        else
                        {
                            foreach (var category in Model)
                            {
                                <a class="dropdown-item" asp-controller="Blog" asp-action="Categories" asp-route-id="@category.CategoriesName">
                                    @category.CategoriesName
                                </a>
                            }
                        }
                    </div>
                </li>

                <li class="nav-item">
                    <a class="nav-link" asp-controller="Tags" asp-action="Index">Tags</a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" asp-controller="Archive" asp-action="Index">Archive</a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" asp-controller="FeedBack" asp-action="Index">FeedBack</a>
                </li>
            </ul>

            <div id="search" class="form-inline my-2 my-lg-0" >
                <input class="form-control" type="search" autocomplete="off" placeholder="Search" data-toggle="popover" data-placement="bottom" oninput="presearch()">
            </div>

        </div>
    </div>

    <script type="text/javascript" src="~/js/components/Navbar.min.js"></script>
</nav>